import java.util.Arrays;
import java.util.Scanner;

public class SummationSpecial {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int[] a = { 14, 27, 89, 33, 56 };
        System.out.println("请输入想获取的数字：");
        int sum = scan.nextInt();

        System.out.println(summation(a, sum));
    }

    public static String summation(int[] a, int sum) {
        int paragon = 0;
        int[] b = { 0, 0 };
        int i = 0;
        int j = 0;

        for ( i = 0; i < a.length; i++) {
            for ( j = 0; j < a.length; j++) {
                if (i != j && a[i] + a[j] == sum) {
                    paragon = 1;
                    break;
                }
            }

            if (paragon == 1) {
                break;
            }
        }

        if (paragon == 1) {
            b[0] = i;
            b[1] = j;
        }
        String end = Arrays.toString(b);

        return end;
    }
}
